package com.py.longtrans.util;


import com.py.longtrans.LongTransClient;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;

public class TimeUtil {

    // 定时任务测试
    public static void main(String[] arg) throws Exception {
//    public static void TimeTaskTest(){
        TimeTask task = new TimeTask();
        MonthTask monthTask = new MonthTask();
        Calendar calendar= Calendar.getInstance();

        Date firstTime = calendar.getTime();
        //日传间隔：30s 后续可能要改
        long period = 1000 * 60;
        //月传间隔：1天 后续可能要改
        long monthPeriod = 1000 * 60 * 60 * 24;

        Timer timer = new Timer();
        Timer monthTimer = new Timer();
        System.out.println("启动线程");
//        LongTransClient server = new LongTransClient();

        timer.schedule(task, firstTime, period); // 日传定时任务
        monthTimer.schedule(monthTask,firstTime,monthPeriod); // 月传定时任务
//        server.load();
        LongTransClient.getFile();

    }



}
